<body class="wy-body">
<div class="layui-fluid">
	<div class="layui-card">
		<div class="layui-form layui-card-header wy-card-header-auto">
			<div class="layui-form-item">
				<form action="{:url(request()->action())}" method="get">
				<div class="layui-inline">
					<label class="layui-form-label wy-width-auto">用户名</label>
					<div class="layui-input-inline">
						<input type="text" name="username" placeholder="请输入用户名" autocomplete="off" class="layui-input" value="{$get_data.username}">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label wy-width-auto">姓名</label>
					<div class="layui-input-inline">
						<input type="text" name="name" placeholder="请输入姓名" autocomplete="off" class="layui-input" value="{$get_data.name}">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label wy-width-auto">手机号</label>
					<div class="layui-input-inline">
						<input type="text" name="tel" placeholder="请输入手机号" autocomplete="off" class="layui-input" value="{$get_data.tel}">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label wy-width-auto">邮箱</label>
					<div class="layui-input-inline">
						<input type="text" name="email" placeholder="请输入邮箱地址" autocomplete="off" class="layui-input" value="{$get_data.email}">
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label wy-width-auto">角色</label>
					<div class="layui-input-inline">
						<select name="role_id">
							<option value="">--请选择--</option>
							{volist name='role_lists' id="vo"}
							<option value="{$vo.id}" {if $get_data.role_id == $vo.id} selected {/if}>{$vo.name}
							{if $vo.status == 0}[&nbsp;禁用&nbsp;]{/if}
							</option>
							{/volist}
						</select>
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label wy-width-auto">状态</label>
					<div class="layui-input-inline">
						<select name="status">
							<option value="">--请选择--</option>
							<option value="1" {if $get_data.status == '1'} selected {/if}>正常</option>
							<option value="0" {if $get_data.status == '0'} selected {/if}>禁用</option>
						</select>
					</div>
				</div>
				<div class="layui-inline">
					<button class="layui-btn">
						<i class="layui-icon layui-icon-search"></i>
					</button>
				</div>
				</form>
			</div>
		</div>

		<div class="layui-card-body">
			<div style="padding-bottom: 10px;">
				<button class="layui-btn wy_but"
					wy-event="lay_parent_tab"
					wy-url="{:url('add')}"
					wy-id="adminuser_info"
					wy-title="添加管理员"
				>添加</button>
			</div>
<table class="layui-table" name="wy_table_lists" lay-filter="wy_table_lists"
	lay-data="{
		height:'full-168',
		cellMinWidth:'180',
		url:'{:url('ajax_lists')}',
		where: {
				{$get_str}
			},
		method:'post',
		page:true,
		id:'wy_table_lists',
		limits:[15,30,50,100]}"
>
<thead>
<tr>
	<th lay-data="{field:'id'}">ID</th>
	<th lay-data="{field:'username'}">用户名</th>
	<th lay-data="{field:'name'}">姓名</th>
	<th lay-data="{field:'tel'}">电话</th>
	<th lay-data="{field:'email'}">邮箱</th>
	<th lay-data="{field:'role_name'}">角色</th>
	<th lay-data="{field:'create_date'}">添加时间</th>
	<th lay-data="{templet:'#statusTool'}">状态</th>
	<th lay-data="{toolbar:'#barTool'}">操作</th>
</tr>
</thead>
</table>

		</div>
	</div>
</div>
<script type="text/html" id="statusTool">
{{# if(d.status == 1 && d.role_status == 1){ }}
	<span class="layui-btn layui-btn-xs layui-btn-success">正常</span>
{{# }else if(d.status == 1 && d.role_status == 0){ }}
	<span class="layui-btn layui-btn-xs layui-btn-disabled">角色禁用</span>
{{# }else if(d.status == 0 && d.role_status == 1){ }}
	<span class="layui-btn layui-btn-xs layui-btn-disabled">用户禁用</span>
{{# }else{ }}
	<span class="layui-btn layui-btn-xs layui-btn-disabled">禁用</span>
{{# } }}
</script>
<script type="text/html" id="barTool">
<div class="layui-btn-group">
	<a class="layui-btn layui-btn-xs layui-btn-primary wy_but"
		wy-event="lay_parent_tab"
		wy-url="{:url('edit')}?id={{d.id}}"
		wy-id="adminuser_info"
		wy-title="编辑管理员"
	>编辑</a>

	<a class="layui-btn layui-btn-xs layui-btn-primary wy_but" 
		wy-event="lay_ajax_get"
		wy-url="{:url('del')}?id={{d.id}}"
		wy-tips="确认是否删除该信息，删除以后将无法恢复"
		wy-table="wy_table_lists"
	>删除</a>
</div>
</script>
</body>